home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5560 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.val.net!usenet
  2. From: agriffini@vv.val.net (Andrea Griffini)
  3. Newsgroups: comp.lang.c,comp.graphics.algorithms,rec.games.programmer
  4. Subject: Re: Speed question here...
  5. Date: Mon, 19 Feb 1996 20:10:06 GMT
  6. Organization: ?
  7. Message-ID: <4g9rbg$3cl@ooze.val.net>
  8. References: <4ftluh$1gkv@hearst.cac.psu.edu>
  9. Reply-To: agriffini@vv.val.net
  10. NNTP-Posting-Host: ppp0.val.net
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. koscho@wjk130.rh.psu.edu (William Koscho) wrote:
  14.  
  15. >I was curious as to how fast something like the 
  16. >following would execute:
  17.  
  18. >    int x;
  19. >    node *ptr;   ptr in linked list
  20.  
  21. >       for ( ptr = first_node; ptr != NULL; ptr = ptr.next ) {
  22. >       for ( x = 0; x < max; x++ ) {
  23. >        array[x] = array_other[x];
  24. >           }
  25. >      } 
  26.  
  27. >I really am not interested in the assignment statement, that's easy.
  28. >but the traversal through the linked list, and inner integer incremental
  29. >for loop for each node visited.  How fast is a traversal through
  30. >a linked list when you do a for loop at each node?
  31.  
  32. >thanks
  33.  
  34. Not blazing fast but fast enough
  35.  
  36. :)
  37.  
  38. BTW: Both if this question has any sense or not (my opinion is that
  39. hasn't)... is anyway graphic related ?
  40.  
  41. --------------------------------------------------_ 
  42. Andrea Griffini         agriffini@vv.val.net       \_
  43.   programmer            a.griffini@agora.stm.it      \_
  44.                         http://vv.val.net/~agriffini   \
  45.  
  46.